package manager
{
	import data.BulletProp;
	import data.MonsterProp;
	import data.TankProp;
	import data.WaveProp;
	
	import utils.GameUtils;

	public class ObjDataManage
	{
		private static var instance:ObjDataManage;
		
		public  var monsterMap:Object;
		
		public  var monsterQueue:Vector.<WaveProp>;
		
		public  var tankMap:Object;
		
		public  var bulletMap:Object;
		
		public function ObjDataManage()
		{
			if(instance)throw new Error("Singerleton!");
			monsterMap={};
			monsterQueue = new Vector.<WaveProp>();
		    tankMap = {};
			bulletMap = {};
		}
		
		public static function getInstance():ObjDataManage{
			return instance ||=new ObjDataManage();
		}
		
		public function getMonsterProp(name:String):MonsterProp{
			if(monsterMap[name]){		
				return monsterMap[name] as MonsterProp;
			}
			trace("Not find this type of monsterprop:"+name);
			return null;
		}
		
		public function getTankProp(name:String):TankProp{
			if(tankMap[name]){		
				return tankMap[name] as TankProp;
			}
			trace("Not find this type of monsterprop:"+name);
			return null;
		}
		
		public function getBulletProp(name:String):BulletProp{
			if(bulletMap[name]){		
				return bulletMap[name] as BulletProp;
			}
			trace("Not find this type of monsterprop:"+name);
			return null;
		}
	}
}